<?php

/**
 * crpCasa
 *
 * @copyright (c) 2009-2010 Daniele Conca
 * @link http://code.zikula.org/crpcasa Support and documentation
 * @author Daniele Conca <conca.daniele@gmail.com>
 * @license GNU/LGPL - v.3
 * @package crpCasa
 */

/**
 * crpCasa Object
 */
class crpCasaUI
{

	function crpCasaUI()
	{

	}

	/**
	 * Draw modify configuration form
	 *
	 * @return string html
	 */
	function modifyConfig($modvars = array ())
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpCasa', false);

		$pnRender->assign($modvars);

		// Return the output that has been generated by this function
		return $pnRender->fetch('crpcasa_admin_modifyconfig.htm');
	}

	/**
	 * Draw main albums list view
	 *
	 * @return string html
	 */
	function albumsList($albums=array(), $startnum=-1, $modvars=array(), $albumsCount=null)
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpCasa');

		$pnRender->assign('startnum',$startnum);
		$pnRender->assign($modvars);
		$pnRender->assign('albums',$albums);
		// Assign the information required to create the pager
		$pnRender->assign('pager', array (
			'numitems' => $albumsCount,
			'itemsperpage' => $modvars['albumsperpage']
		));

		// Return the output that has been generated by this function
		return $pnRender->fetch('crpcasa_user_albums_list.htm');
	}

	/**
	 * Draw main albums list view
	 *
	 * @return string html
	 */
	function imagesList($album=array(), $images=array(), $startnum=-1, $modvars=array(), $imagesCount=null)
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpCasa');

		$pnRender->assign('startnum',$startnum);
		$pnRender->assign($modvars);
		$pnRender->assign('album',$album);
		$pnRender->assign('images',$images);
		// Assign the information required to create the pager
		$pnRender->assign('pager', array (
			'numitems' => $imagesCount,
			'itemsperpage' => $modvars['albumsperpage']
		));

		// Return the output that has been generated by this function
		return $pnRender->fetch('crpcasa_user_album_view.htm');
	}

	/**
	 * Draw main albums list view
	 *
	 * @return string html
	 */
	function imageDisplay($album=array(),$image=array(),$maximage=array(), $expComments=array(), $next=null, $previous=null, $modvars=array())
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpCasa');

		$pnRender->assign($modvars);
		$pnRender->assign('album',$album);
		$pnRender->assign('image',$image);
		$pnRender->assign('maximage',$maximage);
		$pnRender->assign('comments',$expComments);
		$pnRender->assign('previous',$previous);
		$pnRender->assign('next',$next);

		// Return the output that has been generated by this function
		return $pnRender->fetch('crpcasa_user_image_display.htm');
	}
}